<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="webeditor.properties.js"></script>
<title>Asbru Web Content Editor</title>
<script type="text/javascript">

var error = "<?php echo $error ?>";
if (error == 'DISABLED') error = Text('disabled');

// Set href to URL for image
var href = "<?php echo $href ?>";

function requestParameter(name) {
	var value = "";
	if (start = request.indexOf("?"+name+"=")+1) {
		value = request.substring(start+name.length+1);
	} else if (start = request.indexOf("&"+name+"=")+1) {
		value = request.substring(start+name.length+1);
	}
	if (value.indexOf("&")+1) {
		value = value.substring(0, value.indexOf("&"));
	}
	value = unescape(value);
	return value;
}

var request = "" + window.location;
editor = requestParameter("editor");
request_action = '<?php echo $_POST["action"] ?>';
request_id = requestParameter("id");
request_title = '<?php echo $_POST["title"] ?>';
request_href = requestParameter("href");
request_list = requestParameter("list");
request_mediaclass = requestParameter("mediaclass");
if (! request_list) request_list = 'medialist.php?editor=' + editor;

</script>
</head>
<body>
<script type="text/javascript">
	if (error != "") {
		parent.medialist.document.location.href = request_list;
		alert(error);
		document.location.href = 'mediainsert.php?editor=' + editor;
	} else {
		if (request_action == "Delete") {
			parent.ready_link = '';
			parent.ready_href = '';
			parent.ready_mediaclass = '';
			parent.medialist.document.location.href = request_list;
			document.location.href = 'mediainsert.php?action=server&editor=' + editor;
		} else {
			parent.ready_link = request_title;
			parent.ready_href = href;
			parent.ready_mediaclass = request_mediaclass;
			parent.tag["href"] = href;
			parent.medialist.document.location.href = request_list;
			document.location.href = 'mediainsert.php?action=server&editor=' + editor;
		}
	}
</script> 
</body>
</html>
